package com.hsy.crm.web.web.system;

import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.User;
import com.hsy.crm.web.domain.vo.user.UserAuthorityVo;
import com.hsy.crm.web.domain.vo.user.UserPageVo;
import com.hsy.crm.web.service.impl.UserService;
import com.hsy.crm.web.web.BaseAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserAction extends BaseAction {

    Logger logger = LoggerFactory.getLogger(UserAction.class);

    @Autowired
    UserService userService;

    @RequestMapping("/insert")
    public String insert(User user) {
        return Response.body(userService.insertUser(user));
    }

    @RequestMapping("/delete")
    public String delete(User user) {
        return Response.body(userService.deleteUser(user));
    }

    @RequestMapping("/page")
    public String page(UserPageVo userPageVo) {
        return Response.body(userService.page(userPageVo));
    }

    @RequestMapping("/select")
    public String select(User user) {
        return Response.body(userService.selectUser(user));
    }

    @RequestMapping("/get")
    public String get(User user) {
        return Response.body(userService.getUser(user));
    }

    @RequestMapping("/findMenus")
    public String findMenus(User user) {
        return Response.body(userService.findMenus(user));
    }

    @RequestMapping("/authority")
    public String authority(UserAuthorityVo user) {
        return Response.body(userService.authority(user));
    }
/*
    @RequestMapping("/resetpass")
    public String resetpass(User user) {
        return Response.body(userService.resetpass(user));
    }*/


}
